package com.x25175.file.service;

import com.x25175.file.entity.Log;
import com.x25175.file.mapper.LogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 徐佳辉
 * @date 2020/11/30 9:14
 */
@Service
public class LogService {
    @Autowired
    private LogMapper logMapper;


    public int delete(Integer id) {
        int delete = logMapper.delete(id);
        return delete ;
    }
//    public int deleteAfterDay() {
//        int delete = logMapper.deleteAfterDay();
//        return delete;
//    }

    public boolean insert(Log log) {
        return logMapper.insert(log) > 0;
    }

    public boolean insertDynamic(Log log) {
        return logMapper.insertDynamic(log) > 0;
    }

    public boolean updateDynamic(Log log) {
        int i = logMapper.updateDynamic(log);
        return i > 0;
    }

    public boolean update(Log log) {
        return logMapper.update(log) > 0;
    }

    public Log selectById(Integer id) {
        Log log = logMapper.selectById(id);
        return log;
    }

    public List<Log> selectList() {
        List<Log> logs = logMapper.selectList();
        return logs;
    }

}
